import java.util.Deque;
import java.util.LinkedList;
import java.util.Queue;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lenovo
 * Date: 2022-08-16
 * Time: 11:55
 */
public class Test {
    public static void main(String[] args) {
        //双端链表
        Deque<Integer> deque = new LinkedList<>();
    }
    //这样写可用的方法更多
    public static void main3(String[] args) {
        LinkedList<Integer> queue = new LinkedList<>();
    }
    public static void main2(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        System.out.println(queue);
        System.out.println(queue.poll());
        System.out.println(queue);


    }
    public static void main1(String[] args) {
        MyQueue myQueue = new MyQueue();
        myQueue.offer(1);
        myQueue.offer(2);
        myQueue.offer(3);
        myQueue.offer(4);
        System.out.println(myQueue.peek());
        System.out.println(myQueue.poll());
        myQueue.poll();
        myQueue.poll();
        myQueue.poll();
        System.out.println(myQueue.peek());
    }
}
